<!DOCTYPE html>
<html lang="en">

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
		<meta name="Generator" content="EditPlus®">
		<meta name="Author" content="梦想星辰大海">
		<meta name="Keywords" content="">
		<meta name="Description" content="">
		<title>cms后台模板</title>
		<link rel="stylesheet" href="${BASE_PATH}/static/book/res/lib/layui/css/layui.css">
	</head>

	<body>
		<div class="layui-btn-group">
    		<a href="addPage.htm" class="layui-btn">增加</a>
  		</div>
		<div class="layui-form">
		<table class="layui-table" lay-skin="line">
			  <colgroup>
			  	<col width="100">
			  	<col width="100">
			    <col width="200">
			    <col>
			  </colgroup>
			  <thead>
			    <tr>
		    	  <th><input type="checkbox" name="" lay-skin="primary" lay-filter="allChoose"></th>
				  <th>分类ID</th>
			      <th>分类名称</th>
			      <th>操作</th>
			    </tr> 
			  </thead>
			  <tbody>
			  [#list list as cate]
			    <tr>
			      <td><input type="checkbox" name="" lay-skin="primary"></td>
				  <td>${cate.cateId}</td>
			      <td>${cate.name}</td>
			      <td>
				    <a href="edit.htm?id=${cate.cateId}" style="color: #707070;margin-right: 5px;">
						<i class="icon iconfont icon-bianji" style="color: #707070;"></i>编辑
					</a>
				  </td>
		        </tr>
		      [/#list]
		  </tbody>
		</table> 
	  </div>
	</body>
	<script type="text/javascript" src="${BASE_PATH}/static/book/res/lib/layui/layui.js"></script>
	<script>
	layui.use(['laypage', 'layer','form'], function(){
	  var $ = layui.jquery, form = layui.form();
	  var laypage = layui.laypage,layer = layui.layer;
	  
	  //全选
	  form.on('checkbox(allChoose)', function(data){
	    var child = $(data.elem).parents('table').find('tbody input[type="checkbox"]');
	    child.each(function(index, item){
	      item.checked = data.elem.checked;
	    });
	    form.render('checkbox');
	  });
	  
	  
	  //分页
	  laypage({
	    cont: 'demo1'
	    ,pages: 100 //总页数
	    ,groups: 5 //连续显示分页数
	  });
	  
	});
	</script>

</html>